home *** CD-ROM | disk | FTP | other *** search
Makefile | 1995-05-03 | 12.9 KB | 363 lines |
- #
- # Makefile for Reve (an othello game).
- #
- # @(#)Makefile.dist 1.21 91/11/07
- #
- # Copyright (C) 1990, 1991 - Rich Burridge & Yves Gallot.
- # All rights reserved.
- #
- # Permission is granted to copy this source, for redistribution
- # in source form only, provided the news headers in "substantially
- # unaltered format" are retained, the introductory messages are not
- # removed, and no monies are exchanged.
- #
- # Permission is also granted to copy this source, without the
- # news headers, for the purposes of making an executable copy by
- # means of compilation, provided that such copy will not be used
- # for the purposes of competition in any othello tournaments, without
- # prior permission from the authors.
- #
- # No responsibility is taken for any errors inherent either
- # to the comments or the code of this program, but if reported
- # (see README file), then an attempt will be made to fix them.
- #
- #========================================================================
- #
- # There are various small changes needed when compiling reve on
- # different systems. These have been isolated here, and should be
- # uncommented if needed.
- #
- #=======================================================================
- # Full pathname of the reve edge table file. This can also be overridden
- # with a command line option.
- #
- EDGENAMEFILE = $(LIBDIR)/reve.edgetable
- EDGENAME = -DEDGENAME=\"$(EDGENAMEFILE)\"
- #-----------------------------------------------------------------------
- # If you have the poll(2) system call, then uncomment the following
- # definition. Note that you will also have to uncomment the NOSELECT
- # definition. This is needed for SVR4 machines.
- #
- #HASPOLL = -DHASPOLL
- #-----------------------------------------------------------------------
- # Full pathname of the reve online help file. This can also be overridden
- # with a command line option.
- #
- HELPNAMEFILE = $(LIBDIR)/reve.help
- HELPNAME = -DHELPNAME=\"$(HELPNAMEFILE)\"
- #-----------------------------------------------------------------------
- # If your system doesn't have the getdtablesize() library call, then
- # you will need to uncomment the following definition. This will be
- # needed for SVR4.
- #
- #NOGETDTAB = -DNOGETDTAB
- #-----------------------------------------------------------------------
- # Not all machines have the index() string library function. If you
- # don't have this function then you should uncomment the NOINDEX
- # definition below. This definition needs to be uncommented on SVR4
- # machines.
- #
- #NOINDEX = -DNOINDEX
- #-----------------------------------------------------------------------
- # Not every version of Unix (in particular System V derivitives) has the
- # select() system call. If your machine doesn't have this call, then you
- # need to uncomment the following definition.
- #
- #NOSELECT = -DNOSELECT
- #-----------------------------------------------------------------------
- # Some machines do not have the usleep library function. If this is
- # true, then you will need to uncomment this definition.
- #
- #NO_USLEEP = -DNO_USLEEP
- #-----------------------------------------------------------------------
- # If your machine doesn't have a definition for the timeval struct, then
- # you will need to uncomment this definition. It's needed to get Reve to
- # work an an AT&T UNIX PC (aka 7300 or 3b1). It is also needed for SVR4
- # machines.
- #
- #NO_TIMEVAL = -DNO_TIMEVAL
- #------------------------------------------------------------------------
- # The utility program trans, which can create Postscript output from a
- # reve game, uses a prologue file.
- #
- # It is possible to change the location of the trans prologue file
- # by uncommenting the macro definition below and setting appropriately.
- # If it's not present, then a sensible default value is used.
- #
- #PROLOGUE = -DPROLOGUE=\"$(LIBDIR)\"
- #------------------------------------------------------------------------
- # Full pathname of the reve_proc program. This can also be overridden
- # with a command line option.
- #
- REVEPROCFILE = $(LIBDIR)/reve_proc
- REVEPROC = -DREVEPROC=\"$(REVEPROCFILE)\"
- #------------------------------------------------------------------------
- # If you not running under a BSD4.3 derived system, the parameters
- # to the select call are different, and this definition should be
- # uncommented. You need to uncomment this for SunOS v3.x.
- #
- #SELTYPE = -DNO_43SELECT
- #-----------------------------------------------------------------------
- # If you are running on a system, where the second parameter to a signal
- # call is a pointer to an integer function, then this definition needs
- # to be uncommented.
- #
- #SIGRET = -DINT_SIGNAL
- #-----------------------------------------------------------------------
- # If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
- # SVAT, or Xenix286, then you will need to uncomment this definition.
- # This ought to work under 5.3 as well.
- #
- # If you are building reve on an SVR4 machine, then you should also
- # uncomment this definition.
- #
- #SYSV = -DSYSV
- #-----------------------------------------------------------------------
- # If you are trying to build reve on an SVR4 machine, then you should
- # uncomment the following entry, and set SVR4LIBS to the list of SVR4
- # specific libraries needed to link reve.
- #
- #SVR4LIBS = -lnsl -lsocket -lgen
- #-----------------------------------------------------------------------
- # If you are compiling the X11 version under MIT X11R3, you will need to
- # uncomment the following definition:
- #
- #X11R3 = -DX11R3
- #-----------------------------------------------------------------------
- # If you are compiling the X11 version and the X11 include and
- # library files are not in a standard place, then the following
- # two lines should be uncommented, and set appropriately.
- #
- #X11INCDIR = -I$(OPENWINHOME)/include
- #X11LIBDIR = -L$(OPENWINHOME)/lib
- #------------------------------------------------------------------------
- # If you are compiling the XView version, then the following two lines
- # should be uncommented, and set appropriately.
- #
- #XVIEWINCDIR = -I$(OPENWINHOME)/include -DXVIEW
- #XVIEWLIBDIR = -L$(OPENWINHOME)/lib
- #
- #===========================================================================
- #
- # Default locations where Othello files will be installed.
- # You might wish to alter these values.
- #
- BINDIR = /usr/local/games
- LIBDIR = /usr/local/lib
- MANDIR = /usr/man/man$(MANSECT)
- MANSECT = l
- #
- # Options for submakes
- #
- MAKEOPTS = $(MFLAGS) BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) \
- MANDIR=$(MANDIR) PROLOGUE='$(PROLOGUE)'
- #
- # Compilation flags and standard macro definitions.
- #
- CDEFS = $(EDGENAME) $(HASPOLL) $(HELPNAME) $(NOGETDTAB) $(NOINDEX) \
- $(NOSELECT) $(NO_USLEEP) $(NO_TIMEVAL) $(REVEPROC) \
- $(SELTYPE) $(SIGRET) $(SYSV) $(X11R3) $(X11INCDIR) \
- $(XVIEWINCDIR)
- CFLAGS = -O $(CDEFS)
- #
- #==========================================================================
-
- .KEEP_STATE:
-
- BINARIES = sv_reve tty_reve xreve xv_reve
- ETABLE = reve.edgetable
- HFILE = reve.help
-
- CC = cc
-
- REVESRCS = reve_proc.c rev_eval.c rev_ip.c rev_iycp.c
- REVEDSRCS = in.reved.c
- STDSRCS = boardstuff.c events.c get.c items.c makemove.c \
- main.c procs.c socket.c
- REVEOBJS = reve_proc.o rev_eval.o rev_ip.o rev_iycp.o
- REVEDOBJS = in.reved.o
- STDOBJS = boardstuff.o events.o get.o items.o makemove.o \
- main.o procs.o socket.o
-
- GSRCS = reve_ui.c sunview.c tty.c x11.c xview.c
- HDRS = color.h ctl.h extern.h images.h reve.h patchlevel.h reve_ui.h
- IDIR = images
- IMAGES = $(IDIR)/black.xbm \
- $(IDIR)/reve.xbm \
- $(IDIR)/white.xbm \
- $(IDIR)/Ibutton.xbm \
- $(IDIR)/Nbutton.xbm \
- $(IDIR)/Sbutton.xbm \
- $(IDIR)/Ncycle.xbm \
- $(IDIR)/Lcycle.xbm \
- $(IDIR)/Rcycle.xbm \
- $(IDIR)/Scycle.xbm \
- $(IDIR)/Sch_off.xbm \
- $(IDIR)/Sch_on.xbm \
- $(IDIR)/hglass.xbm \
- $(IDIR)/move.xbm \
- $(IDIR)/nocur.xbm \
- $(IDIR)/suggest.xbm
- TDIR = trans
- TFILES = $(TDIR)/Makefile \
- $(TDIR)/README \
- $(TDIR)/trans.c \
- $(TDIR)/trans.ps \
- $(TDIR)/trans.man \
- $(TDIR)/trans.man.text
-
- OTHERS = CHANGES CHANGES.v1-1 README TODO reve.man MANIFEST FILES \
- reve.man.text Makefile.dist
-
- SFILES1 = get.c in.reved.c socket.c
- SFILES2 = makemove.c main.c
- SFILES3 = events.c procs.c
- SFILES4 = items.c reve_proc.c Reve.ad
- SFILES5 = rev_eval.c rev_ip.c rev_iycp.c
- SFILES6 = boardstuff.c $(HDRS)
- SFILES7 = CHANGES CHANGES.v1-1
- SFILES8 = reve.man reve.man.text
- SFILES9 = README TODO MANIFEST FILES Makefile.dist
- SFILES10 = sunview.c tty.c
- SFILES11 = x11.c
- SFILES12 = reve_ui.c xview.c
- SFILES13 = $(IDIR) Imakefile
- SFILES14 = reve.edge1
- SFILES15 = reve.edge2
- SFILES16 = $(TDIR)
- SFILES17 = reve.G
-
- SVIEWLIBS = -lsuntool -lsunwindow -lpixrect
- TTYLIBS = -ltermcap
- X11LIBS = -lX11
- XVIEWLIBS = -lxview -lolgx -lX11
-
- help:
- @echo
- @echo "You need to specify one of the following options:"
- @echo
- @echo " make sunview - to make the SunView version."
- @echo " make tty - to make the dumb tty version."
- @echo " make x11 - to make the X11 version."
- @echo " make xview - to make the XView version."
- @echo
- @echo "This should be followed by:"
- @echo
- @echo " make install"
- @echo " make clean"
- @echo
-
- all: $(BINARIES)
-
- in_reved: $(REVEDOBJS)
- $(CC) -o in.reved $(CFLAGS) $(REVEDOBJS)
-
- reve_proc: $(REVEOBJS)
- $(CC) -o reve_proc $(CFLAGS) $(REVEOBJS)
-
- sunview: $(STDOBJS) sunview.o in_reved reve_proc
- $(CC) -o sv_reve $(CFLAGS) $(STDOBJS) sunview.o $(SVIEWLIBS)
- (cd $(TDIR); $(MAKE) $(MAKEOPTS))
- -cp sv_reve reve
-
- tty: $(STDOBJS) tty.o in_reved reve_proc
- $(CC) -o tty_reve $(CFLAGS) $(STDOBJS) tty.o $(TTYLIBS)
- (cd $(TDIR); $(MAKE) $(MAKEOPTS))
- -cp tty_reve reve
-
- x11: $(STDOBJS) x11.o in_reved reve_proc
- $(CC) -o xreve $(X11LIBDIR) $(CFLAGS) $(STDOBJS) \
- x11.o $(X11LIBS) $(SVR4LIBS)
- (cd $(TDIR); $(MAKE) $(MAKEOPTS))
- -cp xreve reve
-
- xview: $(STDOBJS) reve_ui.o xview.o in_reved reve_proc
- $(CC) -o xv_reve $(XVIEWLIBDIR) $(CFLAGS) $(STDOBJS) \
- reve_ui.o xview.o $(XVIEWLIBS) $(SVR4LIBS)
- (cd $(TDIR); $(MAKE) $(MAKEOPTS))
- -cp xv_reve reve
-
- install:
- -cp reve $(BINDIR)
- -chmod 751 $(BINDIR)/reve
- -strip $(BINDIR)/reve
- -cp reve_proc $(REVEPROCFILE)
- -chmod 751 $(REVEPROCFILE)
- -strip $(REVEPROCFILE)
- -cp in.reved $(LIBDIR)
- -chmod 751 $(BINDIR)/in.reved
- -strip $(BINDIR)/in.reved
- -cat reve.edge1 reve.edge2 > $(ETABLE)
- -cp $(ETABLE) $(LIBDIR)
- -chmod 644 $(LIBDIR)/$(ETABLE)
- -cp reve.man.text $(LIBDIR)/$(HFILE)
- -chmod 644 $(LIBDIR)/$(HFILE)
- -cp reve.man $(MANDIR)/reve.$(MANSECT)
- -chmod 644 $(MANDIR)/reve.$(MANSECT)
- (cd $(TDIR); $(MAKE) $(MAKEOPTS) install)
-
- clean:
- rm -f *.o *.Z *.uu Part* *~ \
- in.reved reve reve_proc $(BINARIES) core
- (cd $(TDIR); $(MAKE) $(MAKEOPTS) clean)
-
- lint: lint-sunview lint-tty lint-xview lint-x11
- lint-reve:
- lint $(CDEFS) $(REVESRCS)
- lint-sunview: lint-reve
- lint $(CDEFS) $(STDSRCS) sunview.c $(SVIEWLIBS)
- lint-tty: lint-reve
- lint $(CDEFS) $(STDSRCS) tty.c $(TTYLIBS)
- lint-xview: lint-reve
- lint $(CDEFS) $(STDSRCS) xview.c $(XVIEWLIBS)
- lint-x11: lint-reve
- lint $(CDEFS) $(STDSRCS) x11.c $(X11LIBS)
-
- saber: $(STDSRCS) x11.c
- #load $(LDFLAGS) $(CDEFS) $(STDSRCS) x11.c $(X11LIBS)
-
- shar:; shar.script $(SFILES1) > reve.part1
- shar.script $(SFILES2) > reve.part2
- shar.script $(SFILES3) > reve.part3
- shar.script $(SFILES4) > reve.part4
- shar.script $(SFILES5) > reve.part5
- shar.script $(SFILES6) > reve.part6
- shar.script $(SFILES7) > reve.part7
- shar.script $(SFILES8) > reve.part8
- shar.script $(SFILES9) > reve.part9
- shar.script $(SFILES10) > reve.part10
- shar.script $(SFILES11) > reve.part11
- shar.script $(SFILES12) > reve.part12
- shar.script $(SFILES13) > reve.part13
- shar.script $(SFILES14) > reve.part14
- shar.script $(SFILES15) > reve.part15
- shar.script $(SFILES16) > reve.part16
- shar.script $(SFILES17) > reve.part17
-
- create: SCCS
- -sccs create $(STDSRCS) $(REVESRCS) items.c reve_proc.c \
- $(GSRCS) $(HDRS) $(IMAGES) $(OTHERS)
-
- SCCS:
- mkdir SCCS
- chmod 755 SCCS
-
- boardstuff.o: boardstuff.c color.h reve.h extern.h
- events.o: events.c reve.h color.h extern.h
- get.o: get.c reve.h extern.h
- in.reved.o: in.reved.c reve.h ctl.h
- items.o: items.c color.h reve.h extern.h
- makemove.o: makemove.c reve.h extern.h
- main.o: main.c reve.h color.h patchlevel.h
- procs.o: procs.c color.h reve.h extern.h
- rev_eval.o: rev_eval.c reve.h
- rev_ip.o: rev_ip.c reve.h
- rev_iycp.o: rev_iycp.c reve.h
- reve_proc.o: reve_proc.c reve.h
- reve_ui.o: reve_ui.c reve_ui.h
- socket.o: socket.c reve.h extern.h ctl.h
- sunview.o: sunview.c reve.h color.h extern.h images.h $(IMAGES)
- tty.o: tty.c reve.h color.h extern.h
- x11.o: x11.c reve.h color.h extern.h images.h $(IMAGES)
- xview.o: xview.c reve.h color.h extern.h images.h $(IMAGES)
-